#ifndef __BSP_ELCDIF_H
#define __BSP_ELCDIF_H

#include "imx6u.h"

unsigned short elcdif_read_lcdID(void);
void elcdif_io_init(void);
void elcdif_reset(void);
void elcdif_enable(void);
void elcdif_clk_init(unsigned char DIV_SELECT , unsigned char LCDIF1_PRED , unsigned char LCDIF1_PODF);
void lcd_clear(unsigned int color);
void lcd_draw_picture(unsigned char *picture);
void lcd_draw_dot(unsigned int x , unsigned int y , unsigned int color);
void lcd_draw_line(unsigned int xs , unsigned int ys , unsigned int xe , unsigned int ye, unsigned int color);
void lcd_draw_love(unsigned char *picture);
unsigned int lcd_read_dot(unsigned int x , unsigned int y);

struct _lcd_dev{
	unsigned short width;
	unsigned short hspw;
	unsigned short hbp;
	unsigned short hfp;
	unsigned short height;
	unsigned short vspw;
	unsigned short vbp;
	unsigned short vfp;
	unsigned int fram_buffer;
	unsigned int backcolor;
	unsigned int forecolor;
	unsigned char pixsize;
};

extern struct _lcd_dev lcd;
/*******************************************DEFINE******************************************/
/*屏幕ID*/
#define ATK4342		0X4342	/* 4.3寸480*272 	*/
#define ATK4384		0X4384	/* 4.3寸800*480 	*/
#define ATK7084		0X7084	/* 7寸800*480 		*/
#define ATK7016		0X7016	/* 7寸1024*600 		*/
#define ATK1018		0X1018	/* 10.1寸1280*800 	*/
#define ATKVGA		0xff00 /* VGA */

/*颜色*/
#define LCD_BLUE		  0x000000FF
#define LCD_GREEN		  0x0000FF00
#define LCD_RED 		  0x00FF0000
#define LCD_CYAN		  0x0000FFFF
#define LCD_MAGENTA 	  0x00FF00FF
#define LCD_YELLOW		  0x00FFFF00
#define LCD_LIGHTBLUE	  0x008080FF
#define LCD_LIGHTGREEN	  0x0080FF80
#define LCD_LIGHTRED	  0x00FF8080
#define LCD_LIGHTCYAN	  0x0080FFFF
#define LCD_LIGHTMAGENTA  0x00FF80FF
#define LCD_LIGHTYELLOW   0x00FFFF80
#define LCD_DARKBLUE	  0x00000080
#define LCD_DARKGREEN	  0x00008000
#define LCD_DARKRED 	  0x00800000
#define LCD_DARKCYAN	  0x00008080
#define LCD_DARKMAGENTA   0x00800080
#define LCD_DARKYELLOW	  0x00808000
#define LCD_WHITE		  0x00FFFFFF
#define LCD_LIGHTGRAY	  0x00D3D3D3
#define LCD_GRAY		  0x00808080
#define LCD_DARKGRAY	  0x00404040
#define LCD_BLACK		  0x00000000
#define LCD_BROWN		  0x00A52A2A
#define LCD_ORANGE		  0x00FFA500
#define LCD_TRANSPARENT   0x00000000

#define LCD_FRAMEBUF_ADDR	(0x89000000)




#endif 